-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Killed RAG feature #727
Conversation
|
📝 WalkthroughWalkthroughThe changes in this pull request involve significant modifications to the web application and backend services, primarily focusing on the removal of the RAG (Retrieval-Augmented Generation) functionality. This includes the deletion of multiple components, services, and modules related to RAG, such as RAG settings pages and associated components. Additionally, a new Dockerfile has been introduced for the web application, and updates have been made to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WebApp
participant API
User->>WebApp: Request Dashboard
WebApp->>API: Fetch Dashboard Data
API-->>WebApp: Return Data
WebApp-->>User: Render Dashboard without RAG Settings
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint (1.23.1)
apps/webapp/next.config.mjsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct. The config "next/core-web-vitals" was referenced from the config file in "/apps/webapp/.eslintrc.json". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
We have finished reviewing your PR. We have found no vulnerabilities. Reply to this PR with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
⛔ Files ignored due to path filters (1)
packages/api/swagger/swagger-spec.yaml
is excluded by!**/*.yaml
📒 Files selected for processing (32)
apps/webapp/Dockerfile.slim
(1 hunks)apps/webapp/next.config.mjs
(2 hunks)apps/webapp/src/app/(Dashboard)/configuration/page.tsx
(0 hunks)apps/webapp/src/components/Configuration/RAGSettings/RAGItemDisplay.tsx
(0 hunks)apps/webapp/src/components/Configuration/RAGSettings/RAGItemList.tsx
(0 hunks)apps/webapp/src/components/Configuration/RAGSettings/RAGLayout.tsx
(0 hunks)apps/webapp/src/components/Configuration/RAGSettings/RAGSettingsPage.tsx
(0 hunks)apps/webapp/src/components/Configuration/RAGSettings/useRagItem.tsx
(0 hunks)apps/webapp/src/components/Configuration/RAGSettings/utils.ts
(0 hunks)packages/api/src/@core/@core-services/module.ts
(1 hunks)packages/api/src/@core/@core-services/unification/ingest-data.service.ts
(0 hunks)packages/api/src/@core/core.module.ts
(0 hunks)packages/api/src/@core/rag/chunking/chunking.service.ts
(0 hunks)packages/api/src/@core/rag/document.processor.ts
(0 hunks)packages/api/src/@core/rag/embedding/embedding.credentials.service.ts
(0 hunks)packages/api/src/@core/rag/embedding/embedding.service.ts
(0 hunks)packages/api/src/@core/rag/loader/loader.service.ts
(0 hunks)packages/api/src/@core/rag/rag.controller.ts
(0 hunks)packages/api/src/@core/rag/rag.dto.ts
(0 hunks)packages/api/src/@core/rag/rag.module.ts
(0 hunks)packages/api/src/@core/rag/rag.service.ts
(0 hunks)packages/api/src/@core/rag/types/index.ts
(0 hunks)packages/api/src/@core/rag/vecdb/chromadb/chromadb.service.ts
(0 hunks)packages/api/src/@core/rag/vecdb/milvus/milvus.service.ts
(0 hunks)packages/api/src/@core/rag/vecdb/pinecone/pinecone.service.ts
(0 hunks)packages/api/src/@core/rag/vecdb/qdrant/qdrant.service.ts
(0 hunks)packages/api/src/@core/rag/vecdb/turbopuffer/turbopuffer.service.ts
(0 hunks)packages/api/src/@core/rag/vecdb/vecdb.credentials.service.ts
(0 hunks)packages/api/src/@core/rag/vecdb/vecdb.service.ts
(0 hunks)packages/api/src/@core/rag/vecdb/weaviate/weaviate.service.ts
(0 hunks)packages/api/src/@core/s3/constants.ts
(0 hunks)packages/api/src/@core/s3/s3.service.ts
(0 hunks)
💤 Files with no reviewable changes (29)
- apps/webapp/src/app/(Dashboard)/configuration/page.tsx
- apps/webapp/src/components/Configuration/RAGSettings/RAGItemDisplay.tsx
- apps/webapp/src/components/Configuration/RAGSettings/RAGItemList.tsx
- apps/webapp/src/components/Configuration/RAGSettings/RAGLayout.tsx
- apps/webapp/src/components/Configuration/RAGSettings/RAGSettingsPage.tsx
- apps/webapp/src/components/Configuration/RAGSettings/useRagItem.tsx
- apps/webapp/src/components/Configuration/RAGSettings/utils.ts
- packages/api/src/@core/@core-services/unification/ingest-data.service.ts
- packages/api/src/@core/core.module.ts
- packages/api/src/@core/rag/chunking/chunking.service.ts
- packages/api/src/@core/rag/document.processor.ts
- packages/api/src/@core/rag/embedding/embedding.credentials.service.ts
- packages/api/src/@core/rag/embedding/embedding.service.ts
- packages/api/src/@core/rag/loader/loader.service.ts
- packages/api/src/@core/rag/rag.controller.ts
- packages/api/src/@core/rag/rag.dto.ts
- packages/api/src/@core/rag/rag.module.ts
- packages/api/src/@core/rag/rag.service.ts
- packages/api/src/@core/rag/types/index.ts
- packages/api/src/@core/rag/vecdb/chromadb/chromadb.service.ts
- packages/api/src/@core/rag/vecdb/milvus/milvus.service.ts
- packages/api/src/@core/rag/vecdb/pinecone/pinecone.service.ts
- packages/api/src/@core/rag/vecdb/qdrant/qdrant.service.ts
- packages/api/src/@core/rag/vecdb/turbopuffer/turbopuffer.service.ts
- packages/api/src/@core/rag/vecdb/vecdb.credentials.service.ts
- packages/api/src/@core/rag/vecdb/vecdb.service.ts
- packages/api/src/@core/rag/vecdb/weaviate/weaviate.service.ts
- packages/api/src/@core/s3/constants.ts
- packages/api/src/@core/s3/s3.service.ts
🧰 Additional context used
🪛 Hadolint (2.12.0)
apps/webapp/Dockerfile.slim
[warning] 4-4: Pin versions in apk add. Instead of apk add <package>
use apk add <package>=<version>
(DL3018)
[warning] 31-31: Use WORKDIR to switch to a directory
(DL3003)
[info] 42-42: Multiple consecutive RUN
instructions. Consider consolidation.
(DL3059)
🪛 Biome (1.9.4)
apps/webapp/next.config.mjs
[error] 2-2: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
🔇 Additional comments (4)
apps/webapp/next.config.mjs (2)
9-9
: 🧹 Nitpick (assertive)
Verify Docker build configuration
The addition of outputFileTracingRoot
is crucial for proper standalone builds, especially in Docker environments. This configuration ensures correct file tracing when building the Next.js application in a containerized environment.
Make sure to:
- Test the Docker build process to ensure all necessary files are included
- Verify that the path resolution works correctly in both development and production environments
- Consider documenting this configuration change in your deployment guides
✅ Verification successful
Docker build configuration is properly set up for standalone builds
The configuration is correctly implemented with proper Docker multi-stage builds and file tracing setup:
- The Dockerfile uses appropriate multi-stage build process with proper workspace setup using Turbo
- The
outputFileTracingRoot
setting in next.config.mjs is correctly pointing to the monorepo root - The .dockerignore properly excludes build artifacts while keeping necessary files for the build
Note: There's a commented warning about possible missing dependencies in standalone mode, but the outputFileTracingRoot
configuration actually helps address this by ensuring correct file tracing from the monorepo root.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify Docker-related configurations
# Check for Dockerfile and docker-compose configurations that might need updates
# Look for Dockerfile
fd Dockerfile
# Check for docker-compose files
fd docker-compose
# Check for .dockerignore to ensure proper file inclusion/exclusion
if [ -f .dockerignore ]; then
echo "Content of .dockerignore:"
cat .dockerignore
fi
Length of output: 791
Script:
#!/bin/bash
# Check the content of webapp's Dockerfile to verify build configuration
cat apps/webapp/Dockerfile
# Check if there are any existing Next.js configurations in other files
rg -A 5 "outputFileTracingRoot"
Length of output: 2207
Line range hint 1-21
: Verify removal of RAG-related configurations
Since this PR aims to remove the RAG feature, let's verify that no RAG-related configurations remain in the codebase.
✅ Verification successful
No RAG-related configurations remain in Next.js config
The search results confirm that the Next.js configuration file and the entire codebase have been properly cleaned of RAG-specific configurations. While there are many file storage related configurations, these are part of the core functionality and not related to the RAG feature that was removed.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Search for any remaining RAG-related configurations
# Search for RAG-related terms in configuration files
echo "Checking for RAG-related configurations..."
rg -i "rag" --type=json --type=yaml --type=javascript --type=typescript
# Specifically check Next.js configuration files
echo "Checking Next.js config files..."
fd "next.config" --exec rg -i "rag" {}
Length of output: 315
Script:
#!/bin/bash
# Let's try a more comprehensive search with correct file extensions
echo "Searching for RAG-related configurations in JS/TS files..."
rg -i "rag" -g "*.js" -g "*.ts" -g "*.mjs" -g "*.json" -g "*.yaml" -g "*.yml"
echo -e "\nChecking Next.js config specifically..."
fd -e mjs -e js "next.config" -x cat {}
Length of output: 102515
🧰 Tools
🪛 Biome (1.9.4)
[error] 2-2: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
packages/api/src/@core/@core-services/module.ts (2)
17-17
: Clean removal of RAG module confirmed
The removal of RagModule from imports aligns with the PR objective of removing the RAG feature. The remaining imports (BullQueueModule, RetryModule) maintain essential functionality.
Line range hint 17-43
: Verify complete removal of RAG dependencies
Let's verify that there are no remaining references to RAG functionality in dependent modules to ensure a clean removal.
✅ Verification successful
RAG dependencies have been successfully removed
The search results confirm that there are no remaining RAG dependencies in the codebase that need attention. The occurrences of "rag" found in the search results are either:
-
Part of unrelated words/terms:
- "storage" in file storage related paths and descriptions
- "drag" in UI component names and properties
- "paragraph" in HTML element types
-
Isolated to webapp hooks that are already being removed:
useRagSettings.tsx
useUpdateRagSettings.tsx
The codebase appears clean with no remaining RAG functionality dependencies that require attention.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Search for any remaining RAG-related references in the codebase
# Search for RAG-related imports, services, or configuration
echo "Searching for RAG-related code..."
rg -i "rag" --type ts --type tsx \
--glob '!{*.test.*,*.spec.*}' \
-g '!**/dist/**' \
-g '!**/node_modules/**'
# Search for potential TODO comments about RAG
echo "Searching for RAG-related TODO comments..."
rg -i "todo.*rag" --type ts --type tsx \
--glob '!{*.test.*,*.spec.*}' \
-g '!**/dist/**' \
-g '!**/node_modules/**'
Length of output: 445
Script:
#!/bin/bash
# Let's modify the search to use only --type ts and add more context with -C flag
echo "Searching for RAG-related code..."
rg -i "rag" --type ts -C 2 \
--glob '!{*.test.*,*.spec.*}' \
-g '!**/dist/**' \
-g '!**/node_modules/**'
# Let's also search for specific RAG-related class or service names
echo "Searching for specific RAG patterns..."
rg -i "(ragservice|ragmodule|ragconfig|ragrepository)" --type ts -C 2 \
--glob '!{*.test.*,*.spec.*}' \
-g '!**/dist/**' \
-g '!**/node_modules/**'
# Let's check for any RAG-related imports
echo "Searching for RAG imports..."
ast-grep --pattern 'import { $$$RAG$$$ } from "$_"'
Length of output: 113036
Script:
#!/bin/bash
# Let's search for RAG-related code in the webapp and hooks specifically
echo "Searching for RAG-related code in webapp..."
rg -i "rag" --type ts -C 2 \
-g "apps/webapp/**" \
--glob '!{*.test.*,*.spec.*}' \
-g '!**/dist/**' \
-g '!**/node_modules/**'
# Let's also check for any RAG-related components or services
echo "Searching for RAG-related components and services..."
rg -i "(userag|ragcomponent|ragservice)" --type ts -C 2 \
-g "apps/webapp/**" \
--glob '!{*.test.*,*.spec.*}' \
-g '!**/dist/**' \
-g '!**/node_modules/**'
# Let's check for any RAG-related API endpoints
echo "Searching for RAG-related API endpoints..."
rg -i "rag" --type ts -C 2 \
-g "packages/api/src/**/*.controller.ts" \
--glob '!{*.test.*,*.spec.*}' \
-g '!**/dist/**' \
-g '!**/node_modules/**'
Length of output: 29916
import path from 'path'; | ||
import { fileURLToPath } from 'url'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use the node:
protocol for Node.js built-in modules
For better clarity and explicit identification of Node.js built-in modules, use the node:
protocol prefix.
-import path from 'path';
-import { fileURLToPath } from 'url';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import path from 'path'; | |
import { fileURLToPath } from 'url'; | |
import path from 'node:path'; | |
import { fileURLToPath } from 'node:url'; |
🧰 Tools
🪛 Biome (1.9.4)
[error] 2-2: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
# Install only production dependencies | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Remove or update the comment about installing production dependencies
The comment # Install only production dependencies
is not followed by any commands, which might cause confusion.
If no action is needed here, consider removing the comment:
- # Install only production dependencies
Alternatively, if you need to install production dependencies, add the appropriate command after the comment.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
# Install only production dependencies |
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Consolidate consecutive RUN
instructions to optimize image layers
Combining multiple RUN
commands into one reduces the number of layers in the final image, improving build efficiency.
You can modify the commands as follows:
- RUN addgroup --system --gid 1001 nodejs
- RUN adduser --system --uid 1001 nextjs
+ RUN addgroup --system --gid 1001 nodejs && \
+ adduser --system --uid 1001 nextjs
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
RUN addgroup --system --gid 1001 nodejs | |
RUN adduser --system --uid 1001 nextjs | |
RUN addgroup --system --gid 1001 nodejs && \ | |
adduser --system --uid 1001 nextjs |
🧰 Tools
🪛 Hadolint (2.12.0)
[info] 42-42: Multiple consecutive RUN
instructions. Consider consolidation.
(DL3059)
RUN apk add --no-cache libc6-compat && \ | ||
corepack enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Pin versions in apk add
command for reproducible builds
To ensure reproducible builds and prevent unexpected issues from package updates, it's recommended to pin the versions when installing packages with apk add
.
You can modify the command as follows:
- RUN apk add --no-cache libc6-compat && \
+ RUN apk add --no-cache libc6-compat=<version> && \
Replace <version>
with the specific version number required.
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 Hadolint (2.12.0)
[warning] 4-4: Pin versions in apk add. Instead of apk add <package>
use apk add <package>=<version>
(DL3018)
RUN pnpm install --shamefully-hoist | ||
|
||
# Build shared package first | ||
RUN cd packages/shared && pnpm run build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Use WORKDIR
instead of cd
for changing directories
Using WORKDIR
to change directories is more efficient and makes the Dockerfile cleaner compared to using cd
in a RUN
command.
You can modify the Dockerfile like this:
- RUN cd packages/shared && pnpm run build
+ WORKDIR /app/packages/shared
+ RUN pnpm run build
If you need to return to the previous directory, you can add another WORKDIR
command after the build step.
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 Hadolint (2.12.0)
[warning] 31-31: Use WORKDIR to switch to a directory
(DL3003)
Summary by CodeRabbit
New Features
Bug Fixes
Chores